//
//  ZYXSettingViewController.m
//  RuiBeiKang
//
//  Created by 代码女神 on 2019/1/7.
//  Copyright © 2019年 JW. All rights reserved.
//

#import "ZYXSettingViewController.h"
#import "ZYXHelpCenterViewController.h"
#import "ZYXRecommendViewController.h"
#import "ZYXLoginViewController.h"
#import "BaseNavigationVC.h"

#import "ZYXLayOutView.h"
@interface ZYXSettingViewController ()
@property (strong,nonatomic) ZYXLayOutView *alterView;
@end

@implementation ZYXSettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"设置";
}
#pragma mark 点击事件
- (IBAction)recommendAction:(id)sender {
    ZYXRecommendViewController *ctrl = [[ZYXRecommendViewController alloc] init];
    [self.navigationController pushViewController:ctrl animated:YES];
}

- (IBAction)helpAction:(id)sender {
    ZYXHelpCenterViewController *ctrl = [[ZYXHelpCenterViewController alloc] init];
    [self.navigationController pushViewController:ctrl animated:YES];
}

- (IBAction)exitAction:(id)sender {
    self.alterView.hidden = NO;
    

}
-(void)clcikSureBtn{
        self.alterView.hidden = YES;
    
      UserInfo *user = [UserInfo sharedUser];
       [user cleanUserInfo];
    self.tabBarController.selectedIndex = 0;
    [self.navigationController popViewControllerAnimated:YES];



}
#pragma mark 懒加载
-(ZYXLayOutView *)alterView{
    if (!_alterView) {
        _alterView = [[NSBundle mainBundle] loadNibNamed:@"ZYXLayOutView" owner:nil options:nil].lastObject;
        _alterView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
        _alterView.titleLabel.text = @"退出账号";
        _alterView.contentLabel.text = @"您确定要退出当前账号吗？";
        [_alterView.sureBtn addTarget:self action:@selector(clcikSureBtn) forControlEvents:UIControlEventTouchUpInside];
    }
    return _alterView;
}
@end
